﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/QuizAdmin.Master" AutoEventWireup="true" CodeBehind="Levels.aspx.cs" Inherits="BladeTecWebApplication.Admin.Levels" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">



<script type="text/javascript">

    function confirmDelete(confirmed) {

        if (!confirmed) {
            $("#dialog-confirm").dialog({
                resizable: false,
                height: 200,
                width: 400,
                modal: true,
                buttons: {
                    "Delete Level(s)": function () {
                        $(this).dialog("close");
                        $("#MainContent_deleteButtonHidden").click();
                    },
                    Cancel: function () {
                        $(this).dialog("close");
                    }
                }
            });
            return false;
        } else {
            return true;
        }

    }

</script>

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">



<span class="pageTitle">View Question Levels</span>
<br /><br />

<asp:Panel cssclass="ui-widget" runat="server" Visible="false" ID="pnlErrorDelete1">
		<div class="ui-state-error ui-corner-all" style="padding: 0 .7em;"> 
			<p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span> 
			<strong>One or more levels could not be deleted because they are still associated 
                with questions.</strong>
			</p>
		</div>
		<br />
	</asp:Panel>

	<asp:GridView ID="gvLevels" runat="server" AutoGenerateColumns="False" CssClass="netsysTable"
		AlternatingRowStyle-CssClass="netsysTableRowAlt" 
		RowStyle-CssClass="netsysTableRow" BorderStyle="None" BorderWidth="0px" 
		>
<AlternatingRowStyle CssClass="netsysTableRowAlt"></AlternatingRowStyle>
		<Columns>
        	<asp:TemplateField>
				<ItemTemplate>
					<!-- --><input type="checkbox" name="level_<%#Eval("LEVEL_ID") %>" value="<%#Eval("LEVEL_ID") %>" /> 
				</ItemTemplate>
			</asp:TemplateField>
		
			<asp:BoundField DataField="LEVEL_DESCRIPTION" HeaderText="Level" />
			<asp:BoundField DataField="LEVEL_WEIGHT" HeaderText="Level Weight" />

        <asp:TemplateField HeaderText="">
				<ItemTemplate>
					<a href="EditQuestionLevels.aspx?level_id=<%#Eval("LEVEL_ID") %>">Edit</a>
				</ItemTemplate>
			</asp:TemplateField>
		</Columns>


<RowStyle CssClass="netsysTableRow"></RowStyle>
	</asp:GridView>


	<div style="width:100%; margin-top: 10px;">
		<asp:Button ID="btnDelete" runat="server" Text="Delete Selected" 
			onclick="btnDelete_Click" OnClientClick="return confirmDelete(false);" 
			ClientIDMode="Predictable" />
		<div style="display:none">
			<asp:Button runat="server" OnClick="btnDelete_Click" ID="deleteButtonHidden" ClientIDMode="Predictable"/>
		</div>
	</div>

	<div id="dialog-confirm" title="Confirm Delete" style="display:none;">
		<p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>Are you sure you want to delete the selected question level(s)?</p>
	</div>

</asp:Content>
